package com.demo.tcp;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.Socket;public class Client {    public static void main(String[] args) throws IOException {        Socket s = new Socket("127.0.0.1",8899);        OutputStream os = s.getOutputStream();        os.write("你好啊".getBytes());        s.shutdownOutput();        InputStream is = s.getInputStream();        byte[] bs = new byte[1024];        int len;        while ((len = is.read(bs)) != -1){            System.out.println(new String(bs,0,len));        }        s.close();    }}